package com.itlong.cloud.smartcard.resource;

import com.itlong.cloud.POJO.PO.TimeTaskDevicePassRecordPO;
import com.itlong.cloud.equip.smartcard.ISmartCardEquipRecordServiceClient;
import com.itlong.cloud.smartcard.service.ISmartCardEquipRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <desc>
 *    处理一卡通上传给云端的通行记录.
 * </desc>
 *
 * @createDate 2018-01-23
 */
@RestController
public class SmartCardEquipRecordServiceResource implements ISmartCardEquipRecordServiceClient {

    @Autowired
    ISmartCardEquipRecordService iSmartCardEquipRecordService;
    /**
     * <desc>
     * 添加一卡通同步到云端的通行记录（目前仅支持添加访客二维码记录）。
     * <desc/>
     *
     * @param recordPOS 通行记录信息
     * @return
     * @author LouisLewis
     * @createDate 2018-01-23
     */
    @Override
    @RequestMapping(path = "/smartCard/syncData/addEquipRecordInfos", method = RequestMethod.POST)
    public Integer addEquipRecordInfos(@RequestBody List<TimeTaskDevicePassRecordPO> recordPOS) throws Exception {
        return iSmartCardEquipRecordService.addEquipRecordInfos(recordPOS);
    }
}
